<?
include '../conn.php';
?>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>课题修改-教师端</title>
    <link rel="stylesheet" type="text/css" href="../css/htmleaf-demo.css">
    <link rel="stylesheet" type="text/css" href="../css/nav.css">
    <link rel="stylesheet" type="text/css" href="../fonts/iconfont.css">

    <link rel="stylesheet" href="../css/bootstrap-theme.css"/>

    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css"/>
    <link rel="stylesheet" href="../css/bootstrap.css"/>
    <script type="text/javascript" src="../js/bootstrap3.0.3.min.js"></script>

    <style>
        #out {
            position: absolute;
            right: 30px;
            top: 20px;
            z-index: 100000;
        }

        .topx {
            margin: 0px;
            padding-top: 50px;
            position: fixed;
            z-index: 999;
            /*浮动部分*/
            /*float:left; */
        }

        .navfont {
            font-family: "黑体";
            font-size: 1.5em;
            padding-top: 10px;
        }

        .indexborder {
            border: 1px transparent;
            border-color: transparent;
            border-color: rgba(0, 0, 0, 0);
            margin-left: 285px;
            margin-right: 5%;

        }

        .bodycolor {
            background-color: gainsboro;
        }

        .box-inline {
            box-shadow: 0px 2px 2px grey;
        }

        .indexdiv1 {
            margin-top: 70px;
            margin-bottom: 20px;
            /*margin-left: 0px;*/
            padding: 2% 2% 2% 2%;
            width: 100%;
            /*height:400px;*/
        }

        .navbackground-t {
            background-color: #003300;
        }

        .indexfooter {
            background-color: dimgray;
            /*height: 50px;*/
            /*position: relative;*/
            position: absolute;
            bottom: 0px;
            width: 100%;
        }

        .footer-p {
            padding-top: 10px;
            padding-left: 210px;
            /*text-align: center;*/
        }

        .paneldiv {
            margin-left: 40px;
        }

        caption {
            text-align: center;
        }

        .table-striped {
            background-color: #DFF0D8
        }

        .thcolor {
            background-color: #8FBC8F;
        }

        .btn {
            margin-left: 0.7em;
        }

        th {
            text-align: center;
        }

        h3 {
            text-align: center;
        }

        .panelbt {
            height: 50px;
            padding-top: 15px;
            background-color: #8FBC8F
        }

        #btn {
            /*float:right;*/
            text-align: right;
            margin-right: 10%;
        }

        @media screen and (max-width: 900px) {
            #nav {
                width: 25%;
                font-size: 0.8em;
            }

            #news {
                width: 100%;
                font-size: 70%;
            }

            .paneldiv {
                width: 100%;
                font-size: 90%;
            }

            .indexborder {
                margin-left: 35%;
                margin-right: 5%;
            }

            .footer-p {
                padding-left: 26%;
            }
        }

        @media screen and (max-width: 400px) {
            #nav {
                width: 25%;
                font-size: 0.5em;
            }

            .navfont {
                font-size: 1em;
            }

            #news {
                width: 100%;
                font-size: 60%;
            }

            .paneldiv {
                width: 100%;
                font-size: 65%;
            }

            .indexborder {
                margin-left: 35%;
                margin-right: 5%;
            }

            .footer-p {
                padding-left: 26%;
            }
        }
    </style>

</head>

<body class="bodycolor">

<nav class="navbar navbar-default navbar-fixed-top" style="clear: left;">
    <div class="container">
        <div class="navbar-right navfont" id="navbar-collapse">
            <p>华软网络技术系毕业管理系统</p>
        </div>
        <a href="t-cookie.php?cookie=out" id="out">退出</a>
    </div>

</nav>

<div class="nav topx navbackground-t" id="nav">
    <div>

        <div style="border-bottom:1px solid rgba(255,255,255,.1)"><img src="../images/mini.png"></div>
    </div>
    <ul>
        <li class="nav-item">
            <a href="t-index.php"><i class="my-icon nav-icon icon_2"></i><span>首页</span><i class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="t-mykt.php"><i class="my-icon nav-icon icon_1"></i><span>我的课题</span><i
                    class="my-icon nav-more"></i></a>
        </li>
        <li class="nav-item">
            <a href="t-checkproject.php"><i class="my-icon nav-icon icon_6"></i><span>选课核查</span><i
                    class="my-icon nav-more"></i></a>
        </li>
        <li class="nav-item">
            <a href="#"><i class="my-icon nav-icon icon_3"></i><span>评分评语</span><i class="my-icon nav-more"></i></a>
            <ul>
                <li>
                    <a href="t-GuideMark.php"><span>指导评分</span></a>
                </li>
                <li>
                    <a href="t-ThesisMark.php"><span>论文评分</span></a>
                </li>
                <li>
                    <a href="t-ReplyMark.php"><span>答辩评分</span></a>
                </li>
            </ul>
        </li>
        <li class="nav-item">
            <a href="t-all.php"><i class="my-icon nav-icon icon_6"></i><span>答辩汇总</span><i
                    class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="#"><i class="my-icon nav-icon icon_3"></i><span>资料管理</span><i class="my-icon nav-more"></i></a>
            <ul>
                <li>
                    <a href="t-information.php"><span>我的资料</span></a>
                </li>
                <li>
                    <a href="t-mystudent.php"><span>我的学生</span></a>
                </li>

            </ul>
        </li>
    </ul>
</div>

<div class="indexborder">

    <center>
        <div class="box-inline indexdiv1 panel panel-default auto" align="center">

            <div class="panel panel-default">
                <div class="panelbt">
                    <h3 class="panel-title">课题修改</h3>
                </div>
                <div class="panel-body">
                    <form action="t-subjectTask.php" method="get">

                        <table style="border: thin; width: 90%;">
                            <tr>
                                <td colspan="2">
                                    <h3>课题信息</h3>

                                </td>
                                <?
                                $ProjectId = $_GET["id"];
                                $sql = "select ProjectName,Category,ProjectOrigin,Summary,Student_StudentId from project
where ProjectId=$ProjectId ";
                                $result = $conn->query($sql);
                                $row = $result->fetch_array();

                                ?>
                            </tr>
                            <tr>
                                <td>
                                    课题名称
                                </td>
                                <td>
                                    <input name="txtTaskName" type="text" value="<?= $row[0] ?>" id="txtTaskName"
                                           style="width:95%;"/>
                                    <input name="id" value="<?= $_GET['id'] ?>" style="display: none">
                                </td>

                            </tr>

                            <tr>
                                <td>
                                    课题类别
                                </td>
                                <td>
                                    <select name="ddlType" id="ddlType" style="height:30px;width:62px;">
                                        <option value=""></option>
                                        <?
                                        if ($row[1] == "设计") {
                                            ?>
                                            <option value="设计" selected="selected">设计</option>
                                            <option value="论文">论文</option>
                                            <option value="其他">其他</option>
                                        <?
                                        }
                                        if ($row[1] == "论文") {
                                            ?>
                                            <option value="设计">设计</option>
                                            <option value="论文" selected="selected">论文</option>
                                            <option value="其他">其他</option>
                                        <?
                                        }
                                        if ($row[1] == "其他") {
                                            ?>
                                            <option value="设计">设计</option>
                                            <option value="论文">论文</option>
                                            <option value="其他" selected="selected">其他</option>
                                        <?
                                        }
                                        ?>
                                    </select>
                                    <span id="r2" style="color:#CC0000;visibility:hidden;">请选择</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    课题来源
                                </td>
                                <td>
                                    <select name="ddlSource" id="ddlSource" style="height:30px;width:62px;">
                                        <option value=""></option>
                                        <?
                                        if ($row[2] == "科研") {
                                            ?>
                                            <option value="科研" selected="selected">科研</option>
                                            <option value="生产">生产</option>
                                            <option value="自拟">自拟</option>
                                        <?
                                        }
                                        if ($row[2] == "生产") {
                                            ?>
                                            <option value="科研">科研</option>
                                            <option value="生产" selected="selected">生产</option>
                                            <option value="自拟">自拟</option>
                                        <?
                                        }
                                        if ($row[2] == "自拟") {
                                            ?>
                                            <option value="科研">科研</option>
                                            <option value="生产">生产</option>
                                            <option value="自拟" selected="selected">自拟</option>
                                        <?
                                        }
                                        ?>


                                    </select>
                                    <span id="r3" style="color:#CC0000;visibility:hidden;">请选择</span>
                                </td>

                            </tr>
                            <tr>
                                <td rowspan="2">
                                    课题简介
                                </td>
                                <td rowspan="2">
											<textarea name="txtTaskDescription" id="txtTaskDescription" rows="20"
                                                      cols="20" id="txtTaskDescription" style="width: 95%">
<?= $row[3] ?></textarea>
                                </td>

                            </tr>
                            <tr></tr>
                            <tr>
                                <td></td>
                                <td><input type="submit" name="btnSaveTask" value=保存课题信息 onclick="savesubject()"></td>
                            </tr>
                            <tr>
                                <td>学生学号</td>
                                <td>
                                    <input name="StudentId" type="text" value="<?= $row[4] ?>" style="width: 95%">
                                </td>
                            </tr>
                            <tr>
                                <td>

                                </td>
                                <td>
                                    <input type="submit" name="btnSaveTask" value=保存学生 onclick="savesubject()">
                                    <input type="submit" name="btnSaveTask" value=删除学生 onclick="savesubject()">
                                </td>

                            </tr>
                        </table>
                    </form>
                </div>
            </div>
            <div id="btn">
                <input type="button" value="删除" class="btn btn-success" onclick="deletekt()">
                <input type="button" value="返回" class="btn btn-success" onclick="back()">
            </div>

        </div>
    </center>
</div>
<!--<footer class="indexfooter container-fluid  bottom">
    <p class="footer-p" align="center">地址：广东省广州市从化区经济开发区高技术产业园广从南路548号 | 电话：020－87818918 邮编：510990 | 网站公安备案编号：4401840100050 粤ICP备：05085382号 站长统计</p>
</footer>-->

<script>

    function deletekt() {
        var msg = "您真的确定要删除吗？\n\n请确认！";
        if (confirm(msg) == true) {
            $.ajax({
                type: "get",
                url: "t-subjectTask.php",
                data: "btnSaveTask=delete&id=" +<?=$ProjectId?>,
                success: function (msg) {
                    alert("Data Delete: " + msg);
                    myWindow = window.open("t-mykt.php", "_self");
                }
            });
        }
    }

    function back() {
        myWindow = window.open("t-mykt.php", "_self");
    }


</script>
<script>
    window.jQuery || document.write('<script src="../js/jquery-1.11.0.min.js"><\/script>')
</script>
<script type="text/javascript" src="../js/nav.js"></script>

</body>

</html>